package com.xdhl.fu.member.controller;


import com.xdhl.fu.common.core.web.domain.AjaxResult;
import com.xdhl.fu.member.domain.vo.TotalMemberVO;
import com.xdhl.fu.member.service.IMemberBasicService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 会员统计控制器
 *
 * @author 朱力维
 * @time 2022/6/9 12:27
 */
@RestController
@RequestMapping("/total/member")
public class TotalMemberController {

    @Resource
    private IMemberBasicService memberBasicService;

    /**
     * 获取会员注册统计信息
     *
     * @return
     */
    @GetMapping("/registed")
    public AjaxResult countGroupRegisteredToday() {
        List<TotalMemberVO> result = memberBasicService.countGroupRegisteredToday();
        return AjaxResult.success(result);
    }

    /**
     * 获取近7天会员活跃统计信息
     *
     * @return 近7填的会员活跃统计信息
     */
    @GetMapping("/active/days7")
    public AjaxResult countMemberActive7Days() {
        List<TotalMemberVO> result = memberBasicService.countMemberActive7Days();
        return AjaxResult.success(result);
    }

}
